<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			var r = Number(prompt("请输入圆的半径长度："));
			function yuan() {
				var a = 2 * Math.PI * r;
				return a;
			}
			if(isNaN(r)){
				alert("请输入数字");
			}else{
				if(r<0){
				alert("请输入正确的半径哦");
				}else{
					var L = yuan();
					document.write("圆的周长为：" + L);
				}
			}
		</script>
	</body>
</html>
